package com.example.draganddrop;

import java.util.ArrayList;

import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.widget.TextView;

public class SecondActivity extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_second);
		Bundle extras = getIntent().getExtras();
		String order = "ERROR IN ORDER";
		if (extras != null) {
			order = "";
			ArrayList<String> vals = (ArrayList) extras.getSerializable("order");
			while(vals != null && !vals.isEmpty()){
				if(!order.equals("")){
					order += ", ";
				}
				order += vals.remove(0);
			}
			TextView tv = (TextView) findViewById(R.id.resultsdisplay);
			tv.setText(order);
		}
		else{
			System.out.println("No info received");
		}
		
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.second, menu);
		return true;
	}

}
